import 'package:flutter_nb_net/flutter_net.dart';

class ContactListResp extends BaseNetModel {
  int? code;
  String? msg;
  List<Contact>? data;
  
  ContactListResp({this.code, this.msg, this.data});

  @override
  fromJson(Map<String, dynamic> json) {
    return ContactListResp(
      code: json['code'],
      msg: json['msg'],
      data: json['data'] == null ? [] : List<Contact>.from(json['data'].map((x) => Contact().fromJson(x))),
    );
  }

}

class Contact extends BaseNetModel{
  int? contactId;
  String? name;
  String? phone;
  int? sort;

  Contact({this.contactId, this.name, this.phone, this.sort});

  @override
  fromJson(Map<String, dynamic> json) {
    return Contact(
      name: json['name'],
      phone: json['phone'],
      sort: json['sort'],
      contactId: json['contactId'],
    );
  }

  toJson() {
    return {
      'name': name,
      'phone': phone,
      'sort': sort,
      'contactId': contactId,
    };
  }
}